package com.qiche.service;

import com.github.pagehelper.PageInfo;
import com.qiche.aspect.Result;
import com.qiche.dto.MemberCardItemDto;
import com.qiche.model.Card;

import java.util.List;

/**
 * Created by Linzw on 2018/01/24.
 */
public interface CardService extends IService<Card>{
    PageInfo<Card> selectByPage(Card card, int start, int length);
    Card selectById(Long id);
	//List<Card> selectAll();
	Card selectByCardcode(String cardCode);
	List<Card> selectByCustomerId(Long customerId);
	Result postCard(Long packId);
	Result isUsed(String cardCode) throws Exception;
	int batchInsert(List<Card> cardList);

	/**
	 * 根据merchantId 获取所有的card 只包含(id,cardAmount,writeoffDate)字段
	 * @param merchantId
	 * @return
	 */
    List<Card> selectCardAmountAllByMerchantId(Integer merchantId);

	/**
	 * 获取此人 在此店的所有卡券
	 * @param merchantId
	 * @param memberPhone
	 * @param sortMoney 查询所有卡券并排序
	 * @return
	 */
    List<MemberCardItemDto> selectMemberCardDtoByMrchantId(Long merchantId, String memberPhone,String sortMoney);
}
